package com.chaofan.websocket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chaofan.websocket.entity.MsgRecordPoJO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

public interface MsgRecordPoJOMapper extends BaseMapper<MsgRecordPoJO> {

    @Select("SELECT id,room_id,user_id,wexin_name,wexin_id,(select image from admin_weixin_user  where wexin_id=b.wexin_id and room=b.room_id limit 1) as image,type,msg,update_time,create_time FROM admin_user_msg_record as b WHERE room_id = #{map.roomId}  ORDER BY id desc")
    IPage<MsgRecordPoJO> selectAllMsg(IPage<MsgRecordPoJO> page, @Param("map") Map map);
}
